package com.day1011;

import javax.print.DocFlavor;
import java.io.*;

public class MapReader {
    public static String[][] readMAP() throws Exception {
        File file = new File("F:\\task\\1.lvl");
        FileReader fileReader = null;
        try {
            fileReader = new FileReader(file);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        BufferedReader bufferedReader = new BufferedReader(fileReader);
        String[][] nums = new String[11][11];

        String str = null;
        int index = 0;
        while ((str = bufferedReader.readLine()) != null){
            String[] num = str.split(",");
            for (int i = 0; i < num.length; i++) {
                nums[index][i] = num[i].trim();
            }
            index ++ ;
        }
        fileReader.close();
        bufferedReader.close();
        return nums;
    }
}
